<template>
  <svg class="icon" :style="{ fill }" @click="clickHandle">
    <use :href="`#${icon}`"></use>
  </svg>
</template>

<script setup>
import './iconfont'
defineProps({
  icon: {
    type: String,
    default: 'icon-yingyuan'
  },
  fill: {
    type: String,
    default: '#ff5f16'
  }
})

const emit = defineEmits(['click'])

const clickHandle = () => {
  emit('click')
}
</script>

<style lang="scss" scoped>
.icon {
  width: 1em;
  height: 1em;
  overflow: hidden;
}
</style>
